<template>
  <div>
  <el-empty v-if="MessageList.length===0" description="当前无消息" image-size="300"
            image="http://localhost:99/Public/file/空空如也.png"></el-empty>
  <div class="card-box" v-if="MessageList.length!==0">
    <el-card :key="item.cdt" v-for="item in MessageList" class="box-card">
      <div slot="header" class="clearfix">
        <span style="font-size: 20px;font-family: 'Adobe 黑体 Std R'">{{ item.author }}</span>
        <span style="float: right">{{ item.cdt.replace("Z","") }}</span>
      </div>
      <div class="text item">
        &nbsp;&nbsp;&nbsp;&nbsp;{{ item.message }}
      </div>
    </el-card>
  </div>
  </div>
</template>

<script>
export default {
  name: "MyMessage",
  data() {
    return {
      MessageList: [],
      noMore: false
    }
  },
  mounted() {
    this.getMessage()
  },
  methods: {
    getMessage() {
      this.$axios.get("/message/getMessage?userId=" + this.$store.getters.getUser.id).then(res => {
        if (res.data.code === 200) {
          this.MessageList = res.data.data
        }
      })
    },
    load() {
      this.noMore = true
    }
  }
}
</script>

<style scoped>
.card-box{
  height: 800px;
  overflow-y: auto

}
.box-card {
  width: 600px;
  margin-left: 150px;
  margin-top: 30px;
}
</style>